package com.wangzhenyu.common.util.toast

import android.widget.Toast

class ToastWrapper {
    //toast展示的字符串
    var text: String? = null

    //toast展示的resourceID
    var res: Int? = null

    //展示成功的标志位
    var showSuccess: Boolean? = null

    //展示失败的标志位
    var showError: Boolean? = null
}

fun toast(init: ToastWrapper.() -> Unit) {
    val wrap = ToastWrapper()
    wrap.init()
    execute(wrap)
}

private fun execute(wrap : ToastWrapper) {
    var taost:Toast ? = null
   // wrap.text?.let { taost = toast(it) }
}